﻿@using MealBooking.Core.Models.Dishes;
@using MealBooking.Core.Models.Meals;
<li data-role="list-divider">Select Dish Categories : </li>
<li>
    <div class="clear ui-bar">
        @{
            List<DishTemplate> selectedDishTemplates = ViewBag.SelectedDishTemplates;
            if (selectedDishTemplates != null && selectedDishTemplates.Count != 0)
            {
                foreach (var dishTemplate in selectedDishTemplates)
                {
            <div class="width-25">
                <label title="@dishTemplate.Category.Description">@dishTemplate.Category.Name
                    <input type="checkbox" name="DishTemplates.Category.Id" class="custom" id="@dishTemplate.Category.Id" value="@dishTemplate.Category.Id"
                checked="checked" />
                </label>
            </div>
            <div class="width-75">
                <label>
                    Dish Sum :
                    <input  type="range" name="DishTemplates.DishSum" class="range" id="@dishTemplate.Category.Id" value="@dishTemplate.DishSum"  min="1" max="9"/>
                </label>
            </div>
                }
            }
            List<DishCategory> dishCategoriesWithoutMealCategory = ViewBag.DishCategoriesWithoutMealCategory;
            if (dishCategoriesWithoutMealCategory != null && dishCategoriesWithoutMealCategory.Count != 0)
            {
                foreach (var dishCategory in dishCategoriesWithoutMealCategory)
                {
            <div class="width-25">
                <label title="@dishCategory.Description">@dishCategory.Name
                    <input type="checkbox" name="DishTemplates.Category.Id" class="custom" id="@dishCategory.Id" value="@dishCategory.Id" />
                </label>
            </div>
            <div class="width-75">
                <label>
                    Dish Sum :
                    <input type="range" name="DishTemplates.DishSum" class="range" id="@dishCategory.Id" value="1" min="1" max="9" />
                </label>
            </div>
                }
            }
            List<DishCategory> dishCategoriesWithMealCategory = ViewBag.DishCategoriesWithMealCategory;
            if (dishCategoriesWithMealCategory != null && dishCategoriesWithMealCategory.Count != 0)
            {
                foreach (var dishCategory in dishCategoriesWithMealCategory)
                {
            <div class="width-25">
                <label title="@dishCategory.Description">@dishCategory.Name [@dishCategory.Category.Name]
                    <input type="checkbox" data-theme="e" name="DishTemplates.Category.Id" class="custom"  id="@dishCategory.Id" value="@dishCategory.Id" />
                </label>
            </div>
            <div class="width-75">
                <label>
                    Dish Sum :
                    <input type="range" name="DishTemplates.DishSum" class="range" id="@dishCategory.Id" value="1" min="1" max="9" />
                </label>
            </div>
                }
            }
        }
    </div>
</li>
